// 引入ajax
import request from '@/utils/request'
// 获取一级分类的接口
// /admin/product/getCategory1 GET
export const reqCategory1=()=>request({url:`/admin/product/getCategory1`,method: 'GET'})

// 获取二级分类的接口
// /admin/product/getCategory2/{category1Id} GET
export const reqCategory2=(category1Id)=>request({url:`/admin/product/getCategory2/${category1Id}`,method: 'GET'})

// 获取三级分类的接口
// /admin/product/getCategory3/{category2Id} GET
export const reqCategory3=(category2Id)=>request({url:`/admin/product/getCategory3/${category2Id}`,method: 'GET'})

// 获取品品牌属性的接口函数
// /admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id}
export const reqAttrList=(category1Id,category2Id,category3Id)=>request({url:`/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`,method: 'GET'})

// 新增或者修改
// /admin/product/saveAttrInfo
export const reqAddOrUpdateAttr=(data)=>{
    if (data.id) {
        return request({url:`/admin/product/saveAttrInfo`,method: 'POST',data})
    }else{
        return request({url:`/admin/product/saveAttrInfo`,method: 'POST',data})

    }
}